home *** CD-ROM | disk | FTP | other *** search
- function initflipcards()
- {
- _root.reporter += "TOLD TO INITFLIPCARDS<br>";
- _root.total = 0;
- _root.frontArray = new Array();
- _root.backArray = new Array();
- _root.frontAudioArray = new Array();
- _root.backAudioArray = new Array();
- _root.frontImageArray = new Array();
- _root.backImageArray = new Array();
- }
- function initXML()
- {
- xmlObj = new XML();
- _root.reporter = _root.reporter + "told to create initxml from:<br>" + thisXML + "<br>";
- xmlObj.load(thisXML);
- _root.reporter += "told to load<br>";
- xmlObj.ignoreWhite = 1;
- xmlObj.onLoad = function(success)
- {
- parseonload();
- };
- }
- function parseonload()
- {
- _root.reporter += "TOLD TO PARSE<br>";
- _root.reporter += "SUCCESS<br>";
- mainNode = xmlObj.firstChild;
- mainName = mainNode.nodeName;
- _root.reporter = _root.reporter + "MAINNODENAME:" + mainName + "<br>";
- childrenOfMain = new Array();
- childrenOfMain = mainNode.childNodes;
- i = 0;
- while(i <= childrenOfMain.length)
- {
- if(childrenOfMain[i].nodeName != null)
- {
- _root.reporter = _root.reporter + "HAS CHILD NODE:" + childrenOfMain[i].nodeName + "<br>";
- _root.total += 1;
- thisChild = childrenOfMain[i];
- nodesofthischild = thisChild.childnodes;
- j = 0;
- while(j < nodesofthischild.length)
- {
- thisTag = nodesOfThisChild[j];
- thisName = thisTag.nodename;
- if(thisTag.nodeName != null)
- {
- if(thisTag.nodeName.tolowercase() == "cardfront")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.frontArray.push(thisElem);
- }
- if(thisTag.nodeName.tolowercase() == "cardback")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.backArray.push(thisElem);
- }
- if(thisTag.nodeName.tolowercase() == "cardfrontaudio")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.frontAudioArray.push(thisElem);
- }
- if(thisTag.nodeName.tolowercase() == "cardbackaudio")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.backAudioArray.push(thisElem);
- }
- if(thisTag.nodeName.tolowercase() == "cardfrontimage")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.frontImageArray.push(thisElem);
- }
- if(thisTag.nodeName.tolowercase() == "cardbackimage")
- {
- thisElem = thisTag.firstchild.nodevalue;
- _root.backImageArray.push(thisElem);
- }
- }
- j++;
- }
- }
- i++;
- }
- }
- thisXML = "flipcard_u3e1.xml";
- if(thisXML != null)
- {
- initflipcards();
- initXML();
- }
- else
- {
- gotoAndPlay(16);
- }
- stopAllSounds();
- stop();
- stop();
-